import http from '@/utils/request.js'
/**
 * 
 * @param {string} username 
 * @param {string} password 
 * @returns 
 */
// export let loginApi = (username, password) =>http.post("/users/login",{username,password})
// export let loginApi = (username, password) =>fetch('http://chst.vip/users/login',{
//     method:'post',
//     headers: {
//         'content-type': 'application/json',
//     },
//     body:JSON.stringify({username,password}),
// }).then(res=>res.json())
export let loginApi = (username, password) =>http({
    method:'post',
    url:"/users/login",
    // headers:{
    //     'content-type': 'application/json'
    // },
    data:{username,password}
})
//获取验证码
export let getCaptchaApi = () => http.get('/users/getCaptcha?v=next')
//校验验证码
export let verifyCaptchaApi = (captcha) => http.get('/users/verifyCaptcha?captcha=' + captcha)
//获取登录日志
export let getLoginLogApi = (page = 1, count = 15) => http.get(`/getloginlog?page=${page}&count=${count}`)
//获取用户列表
export let getUsersListApi = (params) => http.get('/users/getAllUsers', { params })